<template>
  <div class="modify-dialog">
    <slot> </slot>
    <el-dialog v-bind="dialogOpts" :visible.sync="dialogVisible">
      <div class="form-wrap">
        <Form v-bind="formOpts" v-on="formEvent">
          <template #formBtn>
            <div></div>
          </template>
        </Form>
      </div>
      <template #footer>
        <div class="dialog-footer">
          <el-button @click="dialogVisible = false">取 消</el-button>
          <el-button type="primary" @click="onConfirm"> 确 定 </el-button>
        </div>
      </template>
    </el-dialog>
  </div>
</template>

<script>
import modifyMixins from "@/mixins/modifyMixins.vue";

export default {
  mixins: [modifyMixins],
  data() {
    return {
      dialogTitle: "编辑",
      labelPosition: "left",
      form: {
        finishRemark: {
          tag: "el-input",
          label: "备注",
          value: "",
          props: {
            type: "textarea",
            placeholder: "请输入备注",
          },
        },
        departFee: {
          tag: "el-input",
          label: "发车金额",
          value: "",
          props: {
            type: "number",
            min: 0,
            placeholder: "请输入发车金额",
          },
        },
        departImg: {
          tag: "Uploader",
          label: "发车金额截图",
          value: [],
          props: {},
        },
        installFee: {
          tag: "el-input",
          label: "安装金额",
          value: "",
          props: {
            type: "number",
            min: 0,
            placeholder: "请输入安装金额",
          },
        },
        installImg: {
          tag: "Uploader",
          label: "安装金额截图",
          value: [],
          props: {},
        },
        hotelFee: {
          tag: "el-input",
          label: "安装住宿金额",
          value: "",
          props: {
            type: "number",
            min: 0,
            placeholder: "请输入安装住宿金额",
          },
        },
        hotelImg: {
          tag: "Uploader",
          label: "安装住宿金额截图",
          value: [],
          props: {},
        },
        foodFee: {
          tag: "el-input",
          label: "安装工作餐",
          value: "",
          props: {
            type: "number",
            min: 0,
            placeholder: "请输入工作餐额",
          },
        },
        foodImg: {
          tag: "Uploader",
          label: "安装工作餐金额截图",
          value: [],
          props: {},
        },
        trafficFee: {
          tag: "el-input",
          label: "交通金额",
          value: "",
          props: {
            type: "number",
            min: 0,
            placeholder: "请输入交通金额",
          },
        },
        trafficImg: {
          tag: "Uploader",
          label: "交通金额截图",
          value: [],
          props: {},
        },
      },
    };
  },
  computed: {},
  methods: {
    onSubmit(form) {
      const { row } = this;
      form.id = row?.id;
      form.orderId = row?.orderId;
      this.$api["newFinanceRejectUpdate"](form).then(this.submitDoneMsg);
    },
  },
};
</script>

<style lang="less" scoped>
.modify-dialog {
  :deep(.el-form-item__content) {
    width: 220px !important;
  }
}

.form-wrap {
  height: 60vh;
  overflow-y: auto;
}
</style>
